package io.renren.modules.user.service.impl;

import io.renren.modules.user.entity.TPeopleEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.user.dao.TPeopleOutDao;
import io.renren.modules.user.entity.TPeopleOutEntity;
import io.renren.modules.user.service.TPeopleOutService;


@Service("tPeopleOutService")
public class TPeopleOutServiceImpl extends ServiceImpl<TPeopleOutDao, TPeopleOutEntity> implements TPeopleOutService {

    @Autowired
    private  TPeopleOutDao tPeopleOutDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TPeopleOutEntity> page = this.page(
                new Query<TPeopleOutEntity>().getPage(params),
                new QueryWrapper<TPeopleOutEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils listPeopleOut(Map<String, Object> params) {
        IPage<Map<String, Object>> page = new Query<Map<String, Object>>().getPage(params);
        List<Map<String, Object>> maps = tPeopleOutDao.queryPageList(params);
        page.setRecords(maps);
        return new PageUtils(page);
    }
    /**
     * 返聘
     * @param outEntity
     * @return
     */
   public int rehireAfterRetirement(TPeopleOutEntity outEntity){
        return tPeopleOutDao.rehireAfterRetirement(outEntity);
    }
    /**
     * 返聘
     * @param outEntity
     * @return
     */
    public int rehireAfterRetirements(TPeopleOutEntity outEntity){
        return tPeopleOutDao.rehireAfterRetirements(outEntity);
    }

}